//
//  MyHeaderBarNotPower.m
//  CarTown
//
//  Created by xionghao on 15/8/27.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "MyHeaderBarNotPower.h"

@interface MyHeaderBarNotPower ()
@property (weak, nonatomic) IBOutlet UIView *shouchangview;

@end

@implementation MyHeaderBarNotPower

+(instancetype)headerbar{
    MyHeaderBarNotPower *header=[[[NSBundle mainBundle]loadNibNamed:@"MyheaderBar" owner:nil options:nil]lastObject];
  
    
    return header;
}

-(void)awakeFromNib{
    UITapGestureRecognizer *tap2=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(cheyaunclick:)];
    
    self.shouchangview.userInteractionEnabled=YES;
    [self.shouchangview addGestureRecognizer:tap2];
}
- (void)cheyaunclick:(UITapGestureRecognizer *)sender {
    [self clickWithTag:0];
}
- (IBAction)shengjiclick:(UIButton *)sender {
    [self clickWithTag:2];
}

-(void)clickWithTag:(NSInteger)tag{
    if ([_delegate respondsToSelector:@selector(HeadViewBarNotPowerclickWithIndex:)]) {
        [_delegate HeadViewBarNotPowerclickWithIndex:tag];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
